import request from '@/utils/request'

// 获取-分页查询角色列表
export const getRolesList = (params) => {
  return request.get('/sys/role', {
    params
  })
}

// 新增-角色
export const addRole = (data) => {
  return request.post('/sys/role', data)
}

// 编辑角色
export const editRole = (data) => {
  return request.put(`/sys/role/${data.id}`, data)
}

// 删除-角色
export const delRole = (id) => {
  return request.delete(`/sys/role/${id}`)
}

// 获取-角色详情
export const roleDetail = (id) => {
  return request.get(`/sys/role/${id}`)
}

// 分配权限-角色
export const setPermission = (data) => {
  return request.put(`/sys/role/assignPrem`, data)
}

